<%@ page import="coe.pumbaa.Category" %>
<%@ page import="coe.pumbaa.Role" %>
<% def stringManagerService = application.getAttribute("org.codehaus.groovy.grails.APPLICATION_CONTEXT").getBean("stringManagerService") %>

          <fieldset style="width: 48%; float: left; margin-right: 3%;">
            <label>Title</label>
            <g:textField name="title" required="" value="${categoryInstance?.title}" style="width: 92%;"/>
          </fieldset>
          <fieldset style="width: 48%; float: left;">
            <label>Description</label>
            <g:textField name="description" required="" value="${categoryInstance?.description}" style="width: 92%;"/>
          </fieldset><br>
          <fieldset>
            <label>Allow View</label><br><br>
            <g:each in="${Role.list()}" var="role" status="i">
              <g:if test="${role.level > 0}">
                <g:if test="${stringManagerService.checkObjectInString(role,categoryInstance?.allowView)}">
                  <input type="checkbox" name="allowViewList" value="${role.id}" checked="true" /> ${role.type} 
                </g:if><g:else>
                  <input type="checkbox" name="allowViewList" value="${role.id}" /> ${role.type} 
                </g:else>
              </g:if>
            </g:each>
          </fieldset>
          <fieldset>
            <label>Allow Post</label><br><br>
            <g:each in="${Role.list()}" var="role" status="i">
              <g:if test="${role.level > 0}">
                <g:if test="${stringManagerService.checkObjectInString(role,categoryInstance?.allowPost)}">
                  <input type="checkbox" name="allowPostList" value="${role.id}" checked="true" /> ${role.type} 
                </g:if><g:else>
                  <input type="checkbox" name="allowPostList" value="${role.id}" /> ${role.type} 
                </g:else>
              </g:if>
            </g:each>
          </fieldset>

